<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
 <body>
    欢迎${!empty sessionScope.username?username:'游客'}光临
    <div style="position:absolute;left:920px">
	    <a href="${pageContext.request.contextPath}/VoteServlet?method=exit">
	    	退出
	    </a>
    </div>
    <hr/>
    <table border="1" align="center" width="50%">
		<caption>候选人基本信息</caption>
		<tr>
			<th>程度</th>
			<th>姓名</th>
			<th>票数</th>
			<th>操作</th>
		</tr>
		<c:forEach var="vote" items="${voteList}" varStatus="status">
			<tr>	
				<td>
					${status.first==true?'<img src="images/gototop.gif"/>':''}
				</td>
				<td>
					<a target="_blank" href="${pageContext.request.contextPath}/VoteServlet?method=findContentById&id=${vote.id}">
						${vote.content}
					</a>
				</td>
				<td>
					<img src="images/bar.jpg" height="30px" width="${vote.ticket}"/>
					(${vote.ticket}/100)		
				</td>
				<td>
					<c:choose>
						<c:when test="${!empty sessionScope.username}">
							<a href="${pageContext.request.contextPath}/VoteServlet?method=updateVoteById&id=${vote.id}" style="text-decoration:none">
								投票
							</a>
						</c:when>
						<c:otherwise>
								投票						
						</c:otherwise>
					</c:choose>
				</td>
			</tr>
		</c:forEach>
		<tr>
			<td>
				<a href="${pageContext.request.contextPath}/VoteServlet?method=toBackLoginJsp">
					后台管理
				</a>
			</td>
			<td>
				<a href="${pageContext.request.contextPath}/VoteServlet?method=findAllInfo">
					查询投票人情况
				</a>
			</td>
			<td>
				<a href="${pageContext.request.contextPath}/VoteServlet?method=toLoginJsp">
					投票人登录
				</a>
			</td>
		</tr>
    </table>	
  </body>
</html>
